import 'package:flutter/gestures.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/modules/recharge/page/recharge_success/view.dart';
import 'package:honeypotflutter/public/public_total.dart';
import '../recharge_fail/view.dart';

class RechargePayLogic extends GetxController {
  RxInt selectIndex = RxInt(-1);
  final TapGestureRecognizer gestureRecognizer = TapGestureRecognizer();

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    gestureRecognizer.onTap = () {
      HLTotal.total("点击协议");
    };
  }

  /*
  * 点击事件
  * */
  nextClick() {
    if (selectIndex.value < 0) {
      HLTotal.total("请现在支付方式");
      return;
    }

    /// 充值成功或失败结果
    bool recharge = true;
    if (recharge) {
      Get.off(RechargeSuccessPage());
    } else {
      Get.to(RechargeFailPage());
    }
  }
}
